package com.qingmi.farmer.ui.trolley;

import android.databinding.ObservableArrayList;
import android.databinding.ObservableField;
import android.databinding.ObservableList;

import com.wjjun.base.ui.base.ListViewModel;
import com.qingmi.farmer.viewmodel.TrolleyItemViewModel;

/**
 * 买入购物车的ViewModel
 */
public class BuyTrolleyViewModel extends ListViewModel {

    public final ObservableField<Double> totalPrice = new ObservableField<>(0.0);

//    public final ObservableField<Double> freight = new ObservableField<>(0.0);

    public final ObservableList<TrolleyItemViewModel> selectGoods = new ObservableArrayList<>();

    public final ObservableField<Boolean> showManagerBar = new ObservableField<>(false);

    public void toggleShowManagerBar() {
        showManagerBar.set(!showManagerBar.get());
    }

    public void showManagerBar() {
        this.showManagerBar.set(true);
    }

    public void hideManagerBar() {
        this.showManagerBar.set(false);
    }
}
